package com.scnu.yxp.travelapp.adapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.scnu.yxp.travelapp.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class HomePageListViewAdapter extends BaseAdapter {
	private Context context;
	//利用holder存储相应控件
	private ViewHolder viewHolder;
	private List<Map<String, String>> list;

	public HomePageListViewAdapter(Context context, List<Map<String, String>> list)
	{
		this.context = context;
		this.list = list;
	}
	
	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		convertView = LayoutInflater.from(context).inflate(R.layout.homepage_listview_item, null);
		return convertView;
	}
	
	class ViewHolder
	{
		ImageView img;
	}
}



